from django.contrib.auth.mixins import LoginRequiredMixin
from django import http

from utils.response_code import  RETCODE


class LoginRequiredJSONMixin(LoginRequiredMixin):
    def handle_no_permission(self):
        return http.JsonResponse({'code': RETCODE.SESSIONERR, 'errmsg': 'User not logged in'})
